package com.hsxc.cdz.monitor.bean.pile.v1_21;
import com.hsxc.cdz.base.util.BytesUtil;

/**
 * 
 * @author 刘力文
 * 充电桩主动上送的账单报文实体类
 *
 */
public class BillPileMsg extends PileMessage {
	
	private String startTime;  //充电开始时间
	private String endTime;    //充电结束时间
	private String cardNum;    //用户卡号
	private int startRecord;   //充电前电表读数
	private int endRecord;     //充电后电表读数
	private int electricity;   //充电电量
	private int sumMoney;         //充电费用
	private int startCardMon;  //充电开始前卡上余额 
	private int endCardMon;    //充电后卡上余额
	private int serviceMon;   //服务费金额 
	private int isPay;         //是否支付  1 已支付 0 未支付
	
	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getCardNum() {
		return cardNum;
	}

	public void setCardNum(String cardNum) {
		this.cardNum = cardNum;
	}

	public int getStartRecord() {
		return startRecord;
	}

	public void setStartRecord(int startRecord) {
		this.startRecord = startRecord;
	}

	public int getEndRecord() {
		return endRecord;
	}

	public void setEndRecord(int endRecord) {
		this.endRecord = endRecord;
	}

	public int getElectricity() {
		return electricity;
	}

	public void setElectricity(int electricity) {
		this.electricity = electricity;
	}

	public int getSumMoney() {
		return sumMoney;
	}

	public void setSumMoney(int sumMoney) {
		this.sumMoney = sumMoney;
	}

	public int getStartCardMon() {
		return startCardMon;
	}

	public void setStartCardMon(int startCardMon) {
		this.startCardMon = startCardMon;
	}

	public int getEndCardMon() {
		return endCardMon;
	}

	public void setEndCardMon(int endCardMon) {
		this.endCardMon = endCardMon;
	}

	public int getserviceMon() {
		return serviceMon;
	}

	public void setserviceMon(int serviceMon) {
		this.serviceMon = serviceMon;
	}

	public int getIsPay() {
		return isPay;
	}

	public void setIsPay(int isPay) {
		this.isPay = isPay;
	}

	@Override
	public void getContentFromByte(byte[] data) {
		byte[] temp;
       
        temp = BytesUtil.getByte(0,7,data);
        this.setStartTime(BytesUtil.bcdBytesToStr(temp));
        
        temp = BytesUtil.getByte(7,7,data);
        this.setEndTime(BytesUtil.bcdBytesToStr(temp));
        
        temp = BytesUtil.getByte(14,10,data);
        this.setCardNum(BytesUtil.bcdBytesToStr(temp));
        
        temp = BytesUtil.getByte(24,4,data);
        this.setStartRecord(BytesUtil.bytesToIntDesc(temp));
        
        temp = BytesUtil.getByte(28,4,data);
        this.setEndRecord(BytesUtil.bytesToIntDesc(temp));
        
        temp = BytesUtil.getByte(32,4,data);
        this.setElectricity(BytesUtil.bytesToIntDesc(temp));
        
        temp = BytesUtil.getByte(36,4,data);
        this.setSumMoney(BytesUtil.bytesToIntDesc(temp));
        
        temp = BytesUtil.getByte(40,4,data);
        this.setStartCardMon(BytesUtil.bytesToIntDesc(temp));
        
        temp = BytesUtil.getByte(44,4,data);
        this.setEndCardMon(BytesUtil.bytesToIntDesc(temp));
        
        temp = BytesUtil.getByte(48,2,data);
        this.setserviceMon(BytesUtil.bytesToIntDesc(temp));
        
        temp = BytesUtil.getByte(50,1,data);
        this.setIsPay(BytesUtil.bytesToIntSeq(temp));
	}

	@Override
	public String toString() {
		return "BillContent [startTime=" + startTime + ", endTime=" + endTime + ", cardNum=" + cardNum
				+ ", startRecord=" + startRecord + ", endRecord=" + endRecord + ", electricity=" + electricity
				+ ", sumMoney=" + sumMoney + ", startCardMon=" + startCardMon + ", endCardMon=" + endCardMon
				+ ", serviceMon=" + serviceMon + ", isPay=" + isPay + "]";
	}
	
	
}
